package cn.wolfcode.repsitory;

import cn.wolfcode.domain.Region;
import org.springframework.data.annotation.Version;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Description:区域持久化接口
 * @Author:伍家钰
 * @Date:2020/8/7 16:25
 * @Version:1.0
 */
@Repository
public interface RegionRepsitory extends MongoRepository<Region, String> {

    /**
     * 根据区域id获取目的地id集合
     *
     * @param id:
     * @return :
     */
    List<String> findByRefIds(String id);

    /**
     * 查询热门区域并根据sequence排序
     * @param stateHot
     * @return
     */
    List<Region> findByIshotOrderBySequence(int stateHot);
}
